import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    component: () => import('@/views/index')
  },
  {
    path: '/category',
    component: () => import('@/views/category')
  },
  {
    path: '/shopping',
    component: () => import('@/views/shopping')
  },
  {
    path: '/message',
    component: () => import('@/views/message')
  },
  {
    path: '/mine',
    component: () => import('@/views/mine')
  },
  {
    path: '/detail/:goodsId',
    component: () => import('@/views/detail')
  },
  {
    path: '/category/inner',
    component: () => import('@/views/category/inner')
  },
  {
    path: '/productGroup/:groupId',
    component: () => import('@/views/productGroup')
  },
  {
    path: '/login',
    component: () => import('@/views/mine/login')
  },
  {
    path: '/register',
    component: () => import('@/views/mine/register')
  },
  {
    path: '/brand/:brandId',
    component: () => import('@/views/brand')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
